import os
import sys

# 请在此输入您的代码
import datetime

n = int(input())

t = n / 1000

start = datetime.datetime(1970,1,1,0,0)

res = start + datetime.timedelta(seconds=t)

print("{:02}:{:02}:{:02}".format(res.hour,res.minute,res.second))

